#!/usr/bin/env python3

r"""
Contains PEL related constants.
"""

PEL_DETAILS = {
    "CreatorID": "BMC",
    "CompID": "0x1000",
    "Subsystem": "Platform Firmware",
    "Message": "This is a test error",
    "SRC": "BD8D1002",
    "Sev": "Unrecoverable Error",
}

ERROR_LOG_CREATE_BASE_CMD = (
    "busctl call xyz.openubmc_project.Logging /xyz/openubmc_project/logging    "
    " xyz.openubmc_project.Logging.Create Create ssa{ss} "
)

CMD_INTERNAL_FAILURE = (
    ERROR_LOG_CREATE_BASE_CMD
    + "xyz.openubmc_project.Common.Error.InternalFailure    "
    " xyz.openubmc_project.Logging.Entry.Level.Error 0"
)

CMD_FRU_CALLOUT = (
    ERROR_LOG_CREATE_BASE_CMD
    + "xyz.openubmc_project.Sensor.Device.Error.ReadFailure    "
    ' xyz.openubmc_project.Logging.Entry.Level.Error 2 "TIMEOUT_IN_MSEC" "5"'
    ' "CALLOUT_INVENTORY_PATH"    '
    ' "/xyz/openubmc_project/inventory/system/chassis/motherboard"'
)

CMD_PROCEDURAL_SYMBOLIC_FRU_CALLOUT = (
    ERROR_LOG_CREATE_BASE_CMD + "org.open_power.Logging.Error.TestError1    "
    " xyz.openubmc_project.Logging.Entry.Level.Error 0"
)

CMD_INFORMATIONAL_ERROR = (
    ERROR_LOG_CREATE_BASE_CMD
    + "xyz.openubmc_project.Common.Error.TestError2    "
    " xyz.openubmc_project.Logging.Entry.Level.Informational 0"
)

CMD_INVENTORY_PREFIX = (
    "busctl get-property xyz.openubmc_project.Inventory.Manager    "
    " /xyz/openubmc_project/inventory/system/chassis/motherboard"
)

CMD_UNRECOVERABLE_ERROR = (
    ERROR_LOG_CREATE_BASE_CMD + "org.open_power.Logging.Error.TestError1    "
    " xyz.openubmc_project.Logging.Entry.Level.Error 0"
)

CMD_PREDICTIVE_ERROR = (
    ERROR_LOG_CREATE_BASE_CMD
    + "xyz.openubmc_project.Sensor.Threshold.Error.TemperatureWarningLow    "
    " xyz.openubmc_project.Logging.Entry.Level.Warning 0"
)

CMD_UNRECOVERABLE_HOST_ERROR = (
    ERROR_LOG_CREATE_BASE_CMD + "xyz.openubmc_project.Host.Error.Event    "
    " xyz.openubmc_project.Logging.Entry.Level.Error 1 RAWPEL"
    " /tmp/FILE_NBMC_UNRECOVERABLE"
)

CMD_INFORMATIONAL_HOST_ERROR = (
    ERROR_LOG_CREATE_BASE_CMD + "xyz.openubmc_project.Host.Error.Event    "
    " xyz.openubmc_project.Logging.Entry.Level.Error 1 RAWPEL"
    " /tmp/FILE_HOST_INFORMATIONAL"
)
